#ifndef __ViewCtrl_H__
#define __ViewCtrl_H__

#include "Supports\Header.h"
#include "View.h"

#if (CURRENT_PLATFORMP == PLATFORM_WIN32_VS)
	#include "ESWin32View.h"
#endif

#if (CURRENT_PLATFORMP == PLATFORM_ANDROID)
	
#endif

template <class T>
class ViewController
{
protected:
	static ViewController* m_pInstance;
	T* m_pView;
protected:
	ViewController() :m_pView(0){}
public:
	static ViewController* GetInstance(){ return m_pInstance; }
	virtual ~ViewController(){ SAFE_DEL(m_pView); }
	static void CreateView(__UINT32 iWidth, __UINT32 iHeight,const TCHAR* szTitle, __BOOL isFullScreen, __UINT32 iFlag)
	{
		if (!m_pInstance)
		{
			m_pInstance = new ViewController();
#if (CURRENT_PLATFORM == PLATFORM_WIN32_VS)
				//Create new view
			m_pInstance->m_pView = new T(960, 720, TEXT("GAME ENGINE"), iFlag);
				m_pInstance->m_pView->esCreateWindows();
#endif
		}
	}
	T* GetView(){ return m_pView; }
};

#endif